<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>甘肃省皋兰县"两客一危一货"监管大屏</title>
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background: linear-gradient(135deg, #0c1426 0%, #1a2332 50%, #0f1b2e 100%);
            color: #ffffff;
            overflow: hidden;
            height: 100vh;
        }

        .dashboard-container {
            width: 100vw;
            height: 100vh;
            padding: 10px;
            display: grid;
            grid-template-columns: 1fr 2fr 1fr;
            grid-template-rows: 80px 260px 1fr;
            gap: 12px;
        }

        .mega-cards-row {
            grid-column: 1 / -1;
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 12px;
        }

        .mega-card {
            background: linear-gradient(135deg, rgba(0, 150, 255, 0.15) 0%, rgba(0, 255, 150, 0.1) 50%, rgba(255, 107, 107, 0.1) 100%);
            border: 2px solid rgba(0, 255, 150, 0.3);
            border-radius: 15px;
            padding: 15px;
            position: relative;
            overflow: hidden;
            backdrop-filter: blur(15px);
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .mega-card:hover {
            transform: translateY(-3px);
            border-color: rgba(0, 255, 150, 0.6);
            box-shadow: 0 15px 40px rgba(0, 255, 150, 0.2);
        }

        .mega-card::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #00d4ff, #00ff88, #ff6b6b);
            animation: pulse 2s infinite;
        }

        .mega-card-title {
            font-size: 1.3rem;
            font-weight: bold;
            color: #00ff88;
            text-align: center;
            margin-bottom: 15px;
            text-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
            z-index: 10;
            position: relative;
        }

        .mega-metric {
            text-align: center;
            margin: 10px 0;
            z-index: 10;
            position: relative;
        }

        .mega-value {
            font-size: 2.8rem;
            font-weight: bold;
            background: linear-gradient(45deg, #00d4ff, #00ff88, #ff6b6b);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: glow 2s ease-in-out infinite alternate;
        }

        @keyframes glow {
            from { filter: brightness(1); }
            to { filter: brightness(1.2); }
        }

        .mega-label {
            font-size: 1rem;
            color: #a0c4ff;
            margin-top: 5px;
            opacity: 0.9;
        }

        .mega-stats {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-top: 10px;
            z-index: 10;
            position: relative;
        }

        .mega-stat-item {
            text-align: center;
            padding: 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            border: 1px solid rgba(0, 150, 255, 0.2);
        }

        .mega-stat-value {
            font-size: 1.4rem;
            font-weight: bold;
            color: #00d4ff;
        }

        .mega-stat-label {
            font-size: 0.8rem;
            color: #a0c4ff;
            margin-top: 3px;
        }

        .vehicle-flow {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 15px 0;
            position: relative;
            z-index: 10;
        }

        .flow-step {
            width: 45px;
            height: 45px;
            border-radius: 8px;
            background: linear-gradient(45deg, #ff6b6b, #ffaa00, #00d4ff, #00ff88);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            font-weight: bold;
            color: #fff;
            position: relative;
            animation: step-pulse 3s infinite;
        }

        @keyframes step-pulse {
            0%, 100% { box-shadow: 0 0 15px rgba(255, 107, 107, 0.3); }
            50% { box-shadow: 0 0 30px rgba(255, 107, 107, 0.8); }
        }

        .flow-arrow {
            flex: 1;
            height: 3px;
            background: linear-gradient(90deg, #00d4ff, #00ff88);
            margin: 0 8px;
            position: relative;
            overflow: hidden;
        }

        .flow-arrow::after {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
            animation: flow-data 2s infinite;
        }

        @keyframes flow-data {
            0% { left: -100%; }
            100% { left: 100%; }
        }

        .risk-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin: 10px 0;
            z-index: 10;
            position: relative;
        }

        .risk-item {
            background: rgba(255, 107, 107, 0.1);
            border: 1px solid rgba(255, 107, 107, 0.3);
            border-radius: 6px;
            padding: 8px;
            text-align: center;
            font-size: 0.8rem;
            color: #ff6b6b;
            animation: risk-blink 2s infinite;
        }

        .risk-item.medium {
            background: rgba(255, 170, 0, 0.1);
            border-color: rgba(255, 170, 0, 0.3);
            color: #ffaa00;
        }

        .risk-item.low {
            background: rgba(0, 255, 136, 0.1);
            border-color: rgba(0, 255, 136, 0.3);
            color: #00ff88;
        }

        @keyframes risk-blink {
            0%, 100% { opacity: 0.8; }
            50% { opacity: 1; }
        }

        .header {
            grid-column: 1 / -1;
            text-align: center;
            background: linear-gradient(90deg, rgba(0, 150, 255, 0.1) 0%, rgba(0, 255, 150, 0.1) 100%);
            border: 2px solid rgba(0, 150, 255, 0.3);
            border-radius: 15px;
            padding: 10px;
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .header::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
            animation: shine 3s infinite;
        }

        @keyframes shine {
            0% { left: -100%; }
            100% { left: 100%; }
        }

        .header h1 {
            font-size: 2rem;
            font-weight: bold;
            background: linear-gradient(45deg, #00d4ff, #00ff88);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 5px;
        }

        .header .subtitle {
            font-size: 1rem;
            color: #a0c4ff;
            opacity: 0.8;
        }

        .card {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
            border: 1px solid rgba(0, 150, 255, 0.2);
            border-radius: 12px;
            padding: 12px;
            backdrop-filter: blur(10px);
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            min-height: 0;
        }

        .card:hover {
            border-color: rgba(0, 255, 150, 0.4);
            box-shadow: 0 0 30px rgba(0, 255, 150, 0.2);
        }

        .card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: linear-gradient(90deg, #00d4ff, #00ff88, #ff6b6b);
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 0.5; }
            50% { opacity: 1; }
        }

        .card-title {
            font-size: 1.1rem;
            color: #00d4ff;
            margin-bottom: 15px;
            text-align: center;
            font-weight: bold;
        }

        .metric-value {
            font-size: 2rem;
            font-weight: bold;
            text-align: center;
            margin: 10px 0;
        }

        .metric-label {
            font-size: 0.9rem;
            color: #a0c4ff;
            text-align: center;
            opacity: 0.8;
        }

        .chart-container {
            height: 120px;
            margin-top: 8px;
            flex: 1;
            min-height: 100px;
        }

        .status-indicator {
            display: inline-block;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            margin-right: 8px;
            animation: blink 1.5s infinite;
        }

        .status-online { background-color: #00ff88; }
        .status-warning { background-color: #ffaa00; }
        .status-offline { background-color: #ff4444; }

        @keyframes blink {
            0%, 50% { opacity: 1; }
            51%, 100% { opacity: 0.3; }
        }

        .vehicle-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 8px 0;
            padding: 8px;
            background: rgba(0, 150, 255, 0.1);
            border-left: 3px solid #00d4ff;
            border-radius: 5px;
            font-size: 0.9rem;
        }

        .vehicle-item.danger {
            background: rgba(255, 107, 107, 0.1);
            border-left-color: #ff6b6b;
        }

        .vehicle-item.warning {
            background: rgba(255, 170, 0, 0.1);
            border-left-color: #ffaa00;
        }

        .vehicle-plate {
            font-weight: bold;
            color: #00d4ff;
        }

        .vehicle-status {
            color: #a0c4ff;
            font-size: 0.8rem;
        }

        .grid-left {
            display: grid;
            grid-template-rows: repeat(3, 1fr);
            gap: 12px;
            min-height: 0;
        }

        .grid-right {
            display: grid;
            grid-template-rows: repeat(3, 1fr);
            gap: 12px;
            min-height: 0;
        }

        .center-main {
            display: grid;
            grid-template-rows: 1fr 1fr;
            gap: 12px;
            min-height: 0;
        }

        .time-display {
            position: absolute;
            top: 20px;
            right: 20px;
            font-size: 1.1rem;
            color: #00d4ff;
        }

        .enterprise-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin: 6px 0;
            padding: 6px 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 5px;
            font-size: 0.85rem;
        }

        .enterprise-name {
            color: #00d4ff;
            font-weight: bold;
        }

        .enterprise-score {
            color: #00ff88;
        }

        .enterprise-score.warning {
            color: #ffaa00;
        }

        .enterprise-score.danger {
            color: #ff6b6b;
        }
    </style>
</head>

<body>
    <div class="dashboard-container">
        <div class="time-display" id="currentTime"></div>

        <div class="header">
            <h1>甘肃省皋兰县"两客一危一货"监管大屏</h1>
            <div class="subtitle">人车企路一体化 · 闭环管控 · 全链条监管</div>
        </div>

        <!-- 三个大气的统计卡片 -->
        <div class="mega-cards-row">
            <!-- 重点车辆总览 -->
            <div class="mega-card">
                <div class="mega-card-title">重点车辆总览</div>
                <div class="mega-metric">
                    <div class="mega-value" id="totalVehicles">1,248</div>
                    <div class="mega-label">辆重点车辆</div>
                </div>
                <div class="vehicle-flow">
                    <div class="flow-step">客</div>
                    <div class="flow-arrow"></div>
                    <div class="flow-step">危</div>
                    <div class="flow-arrow"></div>
                    <div class="flow-step">货</div>
                </div>
                <div class="mega-stats">
                    <div class="mega-stat-item">
                        <div class="mega-stat-value" id="onlineRate">96.8</div>
                        <div class="mega-stat-label">% GPS在线率</div>
                    </div>
                    <div class="mega-stat-item">
                        <div class="mega-stat-value">24/7</div>
                        <div class="mega-stat-label">全天候监管</div>
                    </div>
                </div>
            </div>

            <!-- 闭环管控体系 -->
            <div class="mega-card">
                <div class="mega-card-title">闭环管控体系</div>
                <div class="mega-metric">
                    <div class="mega-value" id="controlEfficiency">98.2</div>
                    <div class="mega-label">% 管控有效率</div>
                </div>
                <div class="chart-container" id="megaControlChart" style="height: 80px; margin: 10px 0;"></div>
                <div class="mega-stats">
                    <div class="mega-stat-item">
                        <div class="mega-stat-value" id="todayAlerts">15</div>
                        <div class="mega-stat-label">今日告警</div>
                    </div>
                    <div class="mega-stat-item">
                        <div class="mega-stat-value">2.3</div>
                        <div class="mega-stat-label">分钟响应</div>
                    </div>
                </div>
            </div>

            <!-- 风险预警评估 -->
            <div class="mega-card">
                <div class="mega-card-title">风险预警评估</div>
                <div class="mega-metric">
                    <div class="mega-value" id="riskScore">85.6</div>
                    <div class="mega-label">分安全评分</div>
                </div>
                <div class="risk-grid">
                    <div class="risk-item">高风险车辆</div>
                    <div class="risk-item medium">中风险企业</div>
                    <div class="risk-item low">低风险驾驶员</div>
                    <div class="risk-item warning">路线偏离</div>
                </div>
                <div class="mega-stats">
                    <div class="mega-stat-item">
                        <div class="mega-stat-value" id="highRisk">8</div>
                        <div class="mega-stat-label">高风险对象</div>
                    </div>
                    <div class="mega-stat-item">
                        <div class="mega-stat-value">95.2</div>
                        <div class="mega-stat-label">% 预警准确率</div>
                    </div>
                </div>
            </div>
        </div>

        <div class="grid-left">
            <!-- 车辆分类监管 -->
            <div class="card">
                <div class="card-title">车辆分类监管</div>
                <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0;">
                    <div style="text-align: center;">
                        <div><span class="status-indicator status-online"></span>客运车辆</div>
                        <div style="font-size: 0.8rem; color: #00ff88;">285辆在线</div>
                    </div>
                    <div style="text-align: center;">
                        <div><span class="status-indicator status-warning"></span>危化品车</div>
                        <div style="font-size: 0.8rem; color: #ffaa00;">156辆监控</div>
                    </div>
                </div>
                <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px;">
                    <div style="text-align: center;">
                        <div><span class="status-indicator status-online"></span>货运车辆</div>
                        <div style="font-size: 0.8rem; color: #00ff88;">807辆运行</div>
                    </div>
                    <div style="text-align: center;">
                        <div><span class="status-indicator status-online"></span>校车</div>
                        <div style="font-size: 0.8rem; color: #00ff88;">32辆正常</div>
                    </div>
                </div>
                <div class="metric-value" style="color: #00ff88;">1,280</div>
                <div class="metric-label">总监管车辆数</div>
            </div>

            <!-- GPS轨迹监控 -->
            <div class="card">
                <div class="card-title">GPS轨迹监控</div>
                <div class="chart-container" id="gpsTrackChart"></div>
                <div class="metric-value" style="color: #00d4ff;">96.8%</div>
                <div class="metric-label">GPS设备在线率</div>
            </div>

            <!-- 驾驶员管理 -->
            <div class="card">
                <div class="card-title">驾驶员管理</div>
                <div class="chart-container" id="driverManageChart"></div>
                <div class="metric-value" style="color: #00ff88;">1,456</div>
                <div class="metric-label">持证驾驶员</div>
            </div>
        </div>

        <div class="center-main">
            <!-- 皋兰县重点车辆分布图 -->
            <div class="card">
                <div class="card-title">皋兰县重点车辆实时分布</div>
                <div class="chart-container" id="vehicleDistributionChart"></div>
            </div>

            <!-- 电子围栏监控 -->
            <div class="card">
                <div class="card-title">电子围栏监控</div>
                <div class="chart-container" id="electronicFenceChart"></div>
            </div>
        </div>

        <div class="grid-right">
            <!-- 实时告警处置 -->
            <div class="card">
                <div class="card-title">实时告警处置</div>
                <div class="vehicle-item danger">
                    <div>
                        <span class="vehicle-plate">甘A·12345</span>
                        <div class="vehicle-status">危化品车辆偏离路线</div>
                    </div>
                    <div style="color: #ff6b6b; font-size: 0.8rem;">14:25</div>
                </div>
                <div class="vehicle-item warning">
                    <div>
                        <span class="vehicle-plate">甘A·67890</span>
                        <div class="vehicle-status">客运车辆超速行驶</div>
                    </div>
                    <div style="color: #ffaa00; font-size: 0.8rem;">14:18</div>
                </div>
                <div class="vehicle-item">
                    <div>
                        <span class="vehicle-plate">甘A·54321</span>
                        <div class="vehicle-status">货车GPS信号异常</div>
                    </div>
                    <div style="color: #00d4ff; font-size: 0.8rem;">14:12</div>
                </div>
                <div class="metric-value" style="color: #ff6b6b;">12</div>
                <div class="metric-label">待处理告警</div>
            </div>

            <!-- 企业安全评级 -->
            <div class="card">
                <div class="card-title">企业安全评级</div>
                <div class="enterprise-item">
                    <span class="enterprise-name">皋兰运输公司</span>
                    <span class="enterprise-score">92分</span>
                </div>
                <div class="enterprise-item">
                    <span class="enterprise-name">兰州物流集团</span>
                    <span class="enterprise-score warning">78分</span>
                </div>
                <div class="enterprise-item">
                    <span class="enterprise-name">甘肃危化运输</span>
                    <span class="enterprise-score">88分</span>
                </div>
                <div class="enterprise-item">
                    <span class="enterprise-name">皋兰客运站</span>
                    <span class="enterprise-score">95分</span>
                </div>
                <div class="chart-container" id="enterpriseRatingChart"></div>
                <div class="metric-value" style="color: #00ff88;">45</div>
                <div class="metric-label">监管企业数</div>
            </div>

            <!-- 违法违规统计 -->
            <div class="card">
                <div class="card-title">违法违规统计</div>
                <div class="chart-container" id="violationChart"></div>
                <div class="metric-value" style="color: #ff6b6b;">23</div>
                <div class="metric-label">本月违法次数</div>
            </div>
        </div>
    </div>

    <script>
        // 更新时间显示
        function updateTime() {
            const now = new Date();
            const timeStr = now.toLocaleString('zh-CN', {
                year: 'numeric',
                month: '2-digit',
                day: '2-digit',
                hour: '2-digit',
                minute: '2-digit',
                second: '2-digit'
            });
            document.getElementById('currentTime').textContent = timeStr;
        }
        setInterval(updateTime, 1000);
        updateTime();

        // 大气卡片图表 - 闭环管控体系
        const megaControlChart = echarts.init(document.getElementById('megaControlChart'));
        const megaControlOption = {
            backgroundColor: 'transparent',
            grid: { top: 5, right: 5, bottom: 15, left: 25 },
            xAxis: {
                type: 'category',
                data: ['发现', '派发', '处置', '反馈', '闭环'],
                axisLine: { show: false },
                axisTick: { show: false },
                axisLabel: { color: '#a0c4ff', fontSize: 9 }
            },
            yAxis: {
                type: 'value',
                show: false
            },
            series: [{
                data: [100, 98, 95, 92, 98],
                type: 'line',
                smooth: true,
                symbol: 'circle',
                symbolSize: 6,
                lineStyle: { 
                    color: '#00ff88', 
                    width: 3,
                    shadowColor: 'rgba(0, 255, 136, 0.5)',
                    shadowBlur: 10
                },
                itemStyle: { 
                    color: '#00ff88',
                    shadowColor: 'rgba(0, 255, 136, 0.8)',
                    shadowBlur: 8
                },
                areaStyle: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                        { offset: 0, color: 'rgba(0, 255, 136, 0.4)' },
                        { offset: 1, color: 'rgba(0, 255, 136, 0.05)' }
                    ])
                }
            }]
        };
        megaControlChart.setOption(megaControlOption);

        // GPS轨迹监控图表
        const gpsTrackChart = echarts.init(document.getElementById('gpsTrackChart'));
        const gpsTrackOption = {
            backgroundColor: 'transparent',
            grid: { top: 10, right: 10, bottom: 20, left: 30 },
            xAxis: {
                type: 'category',
                data: ['客运', '危化', '货运', '校车'],
                axisLine: { lineStyle: { color: '#4a90e2' } },
                axisLabel: { color: '#a0c4ff', fontSize: 10 }
            },
            yAxis: {
                type: 'value',
                axisLine: { lineStyle: { color: '#4a90e2' } },
                axisLabel: { color: '#a0c4ff', fontSize: 10 },
                splitLine: { lineStyle: { color: 'rgba(74, 144, 226, 0.2)' } }
            },
            series: [{
                data: [98.5, 94.2, 97.8, 100],
                type: 'bar',
                itemStyle: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                        { offset: 0, color: '#00d4ff' },
                        { offset: 1, color: 'rgba(0, 212, 255, 0.3)' }
                    ])
                }
            }]
        };
        gpsTrackChart.setOption(gpsTrackOption);

        // 驾驶员管理图表
        const driverManageChart = echarts.init(document.getElementById('driverManageChart'));
        const driverManageOption = {
            backgroundColor: 'transparent',
            series: [{
                type: 'pie',
                radius: ['40%', '70%'],
                center: ['50%', '50%'],
                data: [
                    { value: 856, name: '正常', itemStyle: { color: '#00ff88' } },
                    { value: 425, name: '即将到期', itemStyle: { color: '#ffaa00' } },
                    { value: 175, name: '已过期', itemStyle: { color: '#ff6b6b' } }
                ],
                label: { show: false },
                emphasis: { scale: false }
            }]
        };
        driverManageChart.setOption(driverManageOption);

        // 皋兰县重点车辆分布图
        const vehicleDistributionChart = echarts.init(document.getElementById('vehicleDistributionChart'));
        const vehicleDistributionOption = {
            backgroundColor: 'transparent',
            tooltip: { 
                trigger: 'item',
                formatter: function(params) {
                    if (params.seriesName === '皋兰县边界') {
                        return '皋兰县行政区域';
                    }
                    return params.name + '<br/>车辆数量: ' + params.value[2] + '辆<br/>类型: ' + params.seriesName;
                }
            },
            grid: { top: 10, right: 10, bottom: 10, left: 10 },
            xAxis: {
                type: 'value',
                min: 0,
                max: 100,
                show: false
            },
            yAxis: {
                type: 'value',
                min: 0,
                max: 100,
                show: false
            },
            series: [
                {
                    name: '皋兰县边界',
                    type: 'lines',
                    data: [
                        { coords: [[15, 85], [25, 90], [35, 88], [45, 85], [55, 82], [65, 78], [75, 75], [85, 70]] },
                        { coords: [[85, 70], [88, 60], [85, 50], [82, 40], [78, 30], [72, 25], [65, 22], [55, 20]] },
                        { coords: [[55, 20], [45, 18], [35, 20], [25, 25], [18, 32], [15, 42], [12, 52], [15, 62]] },
                        { coords: [[15, 62], [18, 72], [15, 85]] }
                    ],
                    lineStyle: {
                        color: 'rgba(0, 255, 136, 0.6)',
                        width: 2
                    }
                },
                {
                    name: '客运车辆',
                    type: 'scatter',
                    data: [
                        { name: '皋兰客运站', value: [50, 55, 45] },
                        { name: '什川客运点', value: [20, 60, 25] },
                        { name: '九合镇站点', value: [40, 70, 18] }
                    ],
                    symbolSize: function(data) {
                        return Math.max(data[2] / 3, 8);
                    },
                    itemStyle: { color: '#00d4ff' }
                },
                {
                    name: '危化品车',
                    type: 'scatter',
                    data: [
                        { name: '工业园区', value: [55, 30, 35] },
                        { name: '化工厂区', value: [75, 50, 28] }
                    ],
                    symbolSize: function(data) {
                        return Math.max(data[2] / 3, 8);
                    },
                    itemStyle: { color: '#ff6b6b' }
                },
                {
                    name: '货运车辆',
                    type: 'scatter',
                    data: [
                        { name: 'G312货运', value: [25, 48, 85] },
                        { name: '物流园区', value: [65, 65, 65] },
                        { name: '黑石川货运', value: [70, 35, 45] }
                    ],
                    symbolSize: function(data) {
                        return Math.max(data[2] / 3, 8);
                    },
                    itemStyle: { color: '#00ff88' }
                },
                {
                    name: '告警车辆',
                    type: 'effectScatter',
                    data: [
                        { name: '偏离路线', value: [30, 47, 1] },
                        { name: '超速告警', value: [60, 40, 1] }
                    ],
                    symbolSize: 12,
                    itemStyle: { color: '#ff6b6b' },
                    rippleEffect: { brushType: 'stroke', scale: 2.5, period: 2 }
                }
            ],
            graphic: [
                {
                    type: 'text',
                    left: 45,
                    top: 55,
                    style: {
                        text: '皋兰县城',
                        fill: '#00ff88',
                        fontSize: 12,
                        fontWeight: 'bold'
                    }
                }
            ]
        };
        vehicleDistributionChart.setOption(vehicleDistributionOption);

        // 电子围栏监控
        const electronicFenceChart = echarts.init(document.getElementById('electronicFenceChart'));
        const electronicFenceOption = {
            backgroundColor: 'transparent',
            tooltip: { trigger: 'axis' },
            legend: {
                data: ['进入围栏', '离开围栏', '违规穿越'],
                textStyle: { color: '#a0c4ff' },
                top: 5
            },
            grid: { top: 35, right: 20, bottom: 30, left: 40 },
            xAxis: {
                type: 'category',
                data: ['08:00', '10:00', '12:00', '14:00', '16:00', '18:00'],
                axisLine: { lineStyle: { color: '#4a90e2' } },
                axisLabel: { color: '#a0c4ff', fontSize: 10 }
            },
            yAxis: {
                type: 'value',
                axisLine: { lineStyle: { color: '#4a90e2' } },
                axisLabel: { color: '#a0c4ff', fontSize: 10 },
                splitLine: { lineStyle: { color: 'rgba(74, 144, 226, 0.2)' } }
            },
            series: [
                {
                    name: '进入围栏',
                    type: 'line',
                    data: [12, 18, 15, 22, 19, 25],
                    lineStyle: { color: '#00ff88' },
                    itemStyle: { color: '#00ff88' }
                },
                {
                    name: '离开围栏',
                    type: 'line',
                    data: [10, 16, 14, 20, 17, 23],
                    lineStyle: { color: '#00d4ff' },
                    itemStyle: { color: '#00d4ff' }
                },
                {
                    name: '违规穿越',
                    type: 'line',
                    data: [2, 3, 1, 4, 2, 3],
                    lineStyle: { color: '#ff6b6b' },
                    itemStyle: { color: '#ff6b6b' }
                }
            ]
        };
        electronicFenceChart.setOption(electronicFenceOption);

        // 企业安全评级图表
        const enterpriseRatingChart = echarts.init(document.getElementById('enterpriseRatingChart'));
        const enterpriseRatingOption = {
            backgroundColor: 'transparent',
            grid: { top: 5, right: 5, bottom: 15, left: 25 },
            xAxis: {
                type: 'category',
                data: ['优秀', '良好', '一般', '较差'],
                axisLine: { show: false },
                axisTick: { show: false },
                axisLabel: { color: '#a0c4ff', fontSize: 9 }
            },
            yAxis: {
                type: 'value',
                show: false
            },
            series: [{
                data: [18, 15, 8, 4],
                type: 'bar',
                barWidth: '60%',
                itemStyle: {
                    color: function(params) {
                        const colors = ['#00ff88', '#00d4ff', '#ffaa00', '#ff6b6b'];
                        return colors[params.dataIndex];
                    }
                }
            }]
        };
        enterpriseRatingChart.setOption(enterpriseRatingOption);

        // 违法违规统计
        const violationChart = echarts.init(document.getElementById('violationChart'));
        const violationOption = {
            backgroundColor: 'transparent',
            grid: { top: 10, right: 10, bottom: 20, left: 30 },
            xAxis: {
                type: 'category',
                data: ['超速', '疲劳', '偏离', '违停', '其他'],
                axisLine: { lineStyle: { color: '#4a90e2' } },
                axisLabel: { color: '#a0c4ff', fontSize: 9 }
            },
            yAxis: {
                type: 'value',
                axisLine: { lineStyle: { color: '#4a90e2' } },
                axisLabel: { color: '#a0c4ff', fontSize: 10 },
                splitLine: { lineStyle: { color: 'rgba(74, 144, 226, 0.2)' } }
            },
            series: [{
                data: [8, 5, 4, 3, 3],
                type: 'bar',
                itemStyle: {
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                        { offset: 0, color: '#ff6b6b' },
                        { offset: 1, color: 'rgba(255, 107, 107, 0.3)' }
                    ])
                }
            }]
        };
        violationChart.setOption(violationOption);

        // 模拟数据更新
        setInterval(function() {
            // 更新大气卡片数据
            const totalVehicles = Math.floor(1248 + Math.random() * 20);
            const onlineRate = (96.8 + Math.random() * 1.0).toFixed(1);
            const controlEfficiency = (98.2 + Math.random() * 0.5).toFixed(1);
            const todayAlerts = Math.floor(15 + Math.random() * 10);
            const riskScore = (85.6 + Math.random() * 5).toFixed(1);
            const highRisk = Math.floor(8 + Math.random() * 5);

            document.getElementById('totalVehicles').textContent = totalVehicles.toLocaleString();
            document.getElementById('onlineRate').textContent = onlineRate;
            document.getElementById('controlEfficiency').textContent = controlEfficiency;
            document.getElementById('todayAlerts').textContent = todayAlerts;
            document.getElementById('riskScore').textContent = riskScore;
            document.getElementById('highRisk').textContent = highRisk;
        }, 3000);

        // 响应式处理
        window.addEventListener('resize', function() {
            megaControlChart.resize();
            gpsTrackChart.resize();
            driverManageChart.resize();
            vehicleDistributionChart.resize();
            electronicFenceChart.resize();
            enterpriseRatingChart.resize();
            violationChart.resize();
        });
    </script>
</body>

</html>